package com.kehutong.wxapi.response;

import org.coraframework.json.annotation.JSONField;

import java.util.List;

/**
 * 通讯录批量搜索响应对象
 * @author: liukunlong
 * @date: 2021-03-08 19:07
 */
public class ContactBatchSearchResponse {

    /**
     * errcode
     */ /**
     * errcode : 0
     * errmsg : ok
     * query_result_list : [{"query_request":{"query_word":"zhangsan","query_type":1,"offset":0,"limit":50},"is_last":false,"query_result":{"user":{"userid":["zhangshan","lisi"],"open_userid":["wwxxxx","wwxxxa"]},"party":{"department_id":[1,2,3]}}}]
     */

    @JSONField(name = "errcode")
    private Integer errcode;
    /**
     * errmsg
     */
    @JSONField(name = "errmsg")
    private String errmsg;
    /**
     * queryResultList
     */
    @JSONField(name = "query_result_list")
    private List<QueryResultListDTO> queryResultList;

    public Integer getErrcode() {
        return errcode;
    }

    public void setErrcode(Integer errcode) {
        this.errcode = errcode;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

    public List<QueryResultListDTO> getQueryResultList() {
        return queryResultList;
    }

    public void setQueryResultList(List<QueryResultListDTO> queryResultList) {
        this.queryResultList = queryResultList;
    }

    public static class QueryResultListDTO {
        /**
         * queryRequest
         */ /**
         * query_request : {"query_word":"zhangsan","query_type":1,"offset":0,"limit":50}
         * is_last : false
         * query_result : {"user":{"userid":["zhangshan","lisi"],"open_userid":["wwxxxx","wwxxxa"]},"party":{"department_id":[1,2,3]}}
         */

        @JSONField(name = "query_request")
        private QueryRequestDTO queryRequest;
        /**
         * isLast
         */
        @JSONField(name = "is_last")
        private Boolean isLast;
        /**
         * queryResult
         */
        @JSONField(name = "query_result")
        private QueryResultDTO queryResult;

        public QueryRequestDTO getQueryRequest() {
            return queryRequest;
        }

        public void setQueryRequest(QueryRequestDTO queryRequest) {
            this.queryRequest = queryRequest;
        }

        public Boolean getIsLast() {
            return isLast;
        }

        public void setIsLast(Boolean isLast) {
            this.isLast = isLast;
        }

        public QueryResultDTO getQueryResult() {
            return queryResult;
        }

        public void setQueryResult(QueryResultDTO queryResult) {
            this.queryResult = queryResult;
        }

        public static class QueryRequestDTO {
            /**
             * queryWord
             */ /**
             * query_word : zhangsan
             * query_type : 1
             * offset : 0
             * limit : 50
             */

            @JSONField(name = "query_word")
            private String queryWord;
            /**
             * queryType
             */
            @JSONField(name = "query_type")
            private Integer queryType;
            /**
             * offset
             */
            @JSONField(name = "offset")
            private Integer offset;
            /**
             * limit
             */
            @JSONField(name = "limit")
            private Integer limit;

            public String getQueryWord() {
                return queryWord;
            }

            public void setQueryWord(String queryWord) {
                this.queryWord = queryWord;
            }

            public Integer getQueryType() {
                return queryType;
            }

            public void setQueryType(Integer queryType) {
                this.queryType = queryType;
            }

            public Integer getOffset() {
                return offset;
            }

            public void setOffset(Integer offset) {
                this.offset = offset;
            }

            public Integer getLimit() {
                return limit;
            }

            public void setLimit(Integer limit) {
                this.limit = limit;
            }
        }

        public static class QueryResultDTO {
            /**
             * user
             */ /**
             * user : {"userid":["zhangshan","lisi"],"open_userid":["wwxxxx","wwxxxa"]}
             * party : {"department_id":[1,2,3]}
             */

            @JSONField(name = "user")
            private UserDTO user;
            /**
             * party
             */
            @JSONField(name = "party")
            private PartyDTO party;

            public UserDTO getUser() {
                return user;
            }

            public void setUser(UserDTO user) {
                this.user = user;
            }

            public PartyDTO getParty() {
                return party;
            }

            public void setParty(PartyDTO party) {
                this.party = party;
            }

            public static class UserDTO {
                /**
                 * userid
                 */
                @JSONField(name = "userid")
                private List<String> userid;
                /**
                 * openUserid
                 */
                @JSONField(name = "open_userid")
                private List<String> openUserid;

                public List<String> getUserid() {
                    return userid;
                }

                public void setUserid(List<String> userid) {
                    this.userid = userid;
                }

                public List<String> getOpenUserid() {
                    return openUserid;
                }

                public void setOpenUserid(List<String> openUserid) {
                    this.openUserid = openUserid;
                }
            }

            public static class PartyDTO {
                /**
                 * departmentId
                 */
                @JSONField(name = "department_id")
                private List<Integer> departmentId;

                public List<Integer> getDepartmentId() {
                    return departmentId;
                }

                public void setDepartmentId(List<Integer> departmentId) {
                    this.departmentId = departmentId;
                }
            }
        }
    }
}
